package com.example.lvsuo.mapper;

import com.example.lvsuo.entity.CaseSealApplyfor;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lvsuo.entity.vo.CaseSealApplyforVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 案件/用印申请 Mapper 接口
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
public interface CaseSealApplyforMapper extends BaseMapper<CaseSealApplyfor> {

    void addBatch(List<CaseSealApplyfor> l);

    @Select("select caseid,GROUP_CONCAT(applyfor_using_the_item) applyfor_using_the_item from case_seal_applyfor where caseid=#{value}")
    CaseSealApplyfor queryCaseSealApplyfor(String id);

    @Select("select c.*,r.file_name item_name from record_file r inner join case_seal_applyfor c where c.applyfor_using_the_item=r.id and caseid=#{value}")
    List<CaseSealApplyforVo> queryCaseSeal(String id);

    List<CaseSealApplyforVo> querySeal(CaseSealApplyforVo c);
}
